unit chatTypes;

interface

uses DateUtils,SysUtils, Classes;

Type
  DWORD   = LongWord;
  PDWORD  = ^DWORD;
  LOWORD  = Word;

  TPeerInfo = record
    PeerIP  : string;
    PeerPort: integer;
  end;

  Procedure ZeroMemory(Destination:Pointer; Length:DWORD);
  procedure CopyMemory(Destination: Pointer; Source: Pointer; Length: DWORD);
  function  MakeWord(A,B:Byte):Word;
  function  MakeLong(A,B:Byte):DWORD;
  function  HiWord(l: DWORD): Word;
  function  GetTickCount:DWord;

implementation

function GetTickCount:Dword;
begin
  result := round(DateTimeToJulianDate(now));
end;

function HiWord(l: DWORD): Word;
begin
  Result := L shr 16;
end;

function MakeLong(A,B:Byte):DWORD;
begin
  Result := A OR B shl 16;
end;

function MakeWord(A,B:Byte):Word;
begin
  Result := A OR B shl 8;      
end;

Procedure ZeroMemory(Destination:Pointer;Length:DWORD);
begin
  FillChar(Destination^, Length,0);
end;

procedure CopyMemory(Destination: Pointer; Source: Pointer; Length: DWORD);
begin
  Move(Source^, Destination^, Length);
end;

end.
